<%@page import="java.security.MessageDigest"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String account=request.getParameter("account");
    String password=request.getParameter("password");

    //雜湊密碼
    MessageDigest md = MessageDigest.getInstance("SHA-256");        
    byte[] bb=md.digest(password.getBytes());
    
    boolean ans=false;
    db.NWDB mydb=new db.NWDB();
    if(mydb.vaildAccountLogin(account, bb))            
    {
        int memberID = mydb.getAcccountID(account, bb);
        session.setAttribute("MemberID",memberID);
        session.setAttribute("LoginName", account.toLowerCase());
        ans=true;
    }
    mydb.dbClose();
    
    if(ans)
        out.print("t");
    else
        out.print("f");
    %>

